var _excluded = ['valuePropName', 'renderDetailItem'];
function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};
  var target = _objectWithoutPropertiesLoose(source, excluded);
  var key, i;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;
  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }
  return target;
}
import React, { Fragment } from 'react';
import './index.less';
var defaultRenderItem = function defaultRenderItem(val) {
  return val
    ? /*#__PURE__*/ React.createElement('span', {
        className: 'szzj-field-image-detail-img',
        style: {
          backgroundImage: val,
        },
      })
    : null;
};
export default function ImageDetail(_ref) {
  var valuePropName = _ref.valuePropName,
    _ref$renderDetailItem = _ref.renderDetailItem,
    renderDetailItem = _ref$renderDetailItem === void 0 ? defaultRenderItem : _ref$renderDetailItem,
    rest = _objectWithoutProperties(_ref, _excluded);
  var value = valuePropName ? rest[valuePropName] : rest.value;
  return /*#__PURE__*/ React.createElement(
    Fragment,
    null,
    Array.isArray(value)
      ? /*#__PURE__*/ React.createElement(
          'div',
          {
            className: 'szzj-field-image-detail',
          },
          value.map(function (val) {
            return /*#__PURE__*/ React.createElement(
              'span',
              {
                key: val,
              },
              renderDetailItem(val),
            );
          }),
        )
      : renderDetailItem(value),
  );
}
